﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KCZCList.aspx.cs" Inherits="RN.ERP.Web.Exam.KCZCList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title><%=PageTitle %></title>
    
    <link href="../Styles/style.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/style_msg.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/iepngfix_tilebg.js"></script>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
    </script>
	<script type="text/javascript" language="JavaScript">
	    var printWB;
	    $(function () {
	        printWB = document.getElementById("printWB");
	        PrintPageRerender();
	    });

	    ////为了打印时边线的显示问题，对页面进行再处理
	    function PrintPageRerender() {
	        var seats = $("#seat-container .seat-area");
	        ////页面上每行座次数
	        var ROW_SEAT_COUNT = 3;
	        ////每页行数(第一页例外)
	        var PAGE_ROW_COUNT = 5;
	        ////座次行数
	        var rowCount = Math.ceil(seats.length / ROW_SEAT_COUNT);
	        ////页数
	        var pageCount = Math.ceil(rowCount / PAGE_ROW_COUNT);

	        var seatStartIndex;
	        for (var pageIndex = 1; pageIndex < pageCount; pageIndex++) {
	            seatStartIndex = pageIndex * PAGE_ROW_COUNT * ROW_SEAT_COUNT;
	            $("#roomInfo").clone().addClass("roomInfo-print").insertBefore(seats.eq(seatStartIndex));
	            $("<div class='line-holder'></div>").insertAfter(seats.eq(seatStartIndex - 1));
	        }
	    }

	    function doPrintSetup() {
	        //打印设置
	        printWB.ExecWB(8, 1)
	    }
	    function doPrintPreview() {
	        //打印预览
	        printWB.ExecWB(7, 1)
	    }
	    function doPrint() {
	        //直接打印
	        printWB.ExecWB(6, 6)
	    }

	    var HKEY_Root, HKEY_Path, HKEY_Key;
	    HKEY_Root = "HKEY_CURRENT_USER";
	    HKEY_Path = "\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
	    var head, foot, top, bottom, left, right;

	    //设置网页打印的页眉页脚和页边距  
	    function PageSetup_Null() {
	        try {
	            var Wsh = new ActiveXObject("WScript.Shell");

	            //设置页眉
	            HKEY_Key = "header";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "--考场安排信息--");

	            //设置页脚（为空）
	            HKEY_Key = "footer";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");

	            var bottom;
	            if (/MSIE [78]/.test(window.navigator.userAgent)) {
	                bottom = "1.159";
	            } else {
	                bottom = "0.999";
	            }

	            //设置下页边距 1.159
	            HKEY_Key = "margin_bottom";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, bottom);

	            //设置左页边距
	            HKEY_Key = "margin_left";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "0.4");

	            //设置右页边距
	            HKEY_Key = "margin_right";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "0.4");

	            //设置上页边距 1.18对应于30毫米
	            HKEY_Key = "margin_top";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "1.099");

	            //设置【启用缩小字体填充】
	            HKEY_Key = "Shrink_To_Fit";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "yes");

	            //设置【打印背景颜色和图像】
	            HKEY_Key = "Print_Background";
	            Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "no");
	        } catch (e) {
	            alert("请阅读【打印准考证提示】并设置相关浏览器属性。");
	        }
	    }

	    PageSetup_Null();
    </script>
    <style type="text/css">
        *{margin:0px;padding:0px;}
        #main{width:921px;}
        .IE6png_{behavior: url("../Scripts/iepngfix.htc");}
        .text_css{border: 2px;height: 24px;line-height: 24px;}
        .icon_li{padding: 0px 20px;background: url(../images/icon_li.jpg) repeat-x;float: right;}
        .icon_li a{line-height: 48px;display: block;color: #936205;font-size: 18px;font-weight: bold;text-align: center;}
        .icon_li a:hover{text-decoration: none;}
        
        #roomInfo{border: 2px solid grey;padding: 14px;line-height:40px;font-size:14px;text-align:left;
                  font-family: 宋体;height:123px;width:829px;margin:15px 0px;clear:both;}
        #seat-container{padding:0 0 4px 0;border:none;}
        .signArea{width: 120px;height: 35px;margin: 0px 0px 5px;border: 1px solid black;}
        .seat-area{padding-left: 10px; text-align: left; float: left; width: 276px; border: 1px #cccccc solid;margin:2px -1px -3px 0;}
        
        .noprint{margin:20px 0px;}
        .noprint input{padding:5px 10px;margin:10px 5px;}
        .noprint ul{padding:0px 50px;}
        .noprint ul li{list-style-type:square;margin:5px;}

        .roomInfo-print{display:none;}
		.line-holder{clear:both;height:60px;display:none;}
    </style>
	<style media="print">
		.noprint { display : none;}
        .roomInfo-print{display:block;}
		.line-holder{display:block;}
	</style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width:881px;margin:0px auto;">
    <div class="noprint">
        <h3>打印准考证提示</h3>
        <ul>
            <li>
                <p>点击【打印】按钮前要更改浏览器设置：IE7及IE8用户，请先选择浏览器的“工具”-->“Internet选项”-->“安全”-->“自定义级别”中的</p>
                <p>“对未标记为可安全执行脚本的ActiveX控件初始化并执行脚本”以及“下载未签名的ActiveX控件”设置为“启用”或“提示”。</p>
                <p>IE8以上用户，请先选择浏览器右上角的设置按钮然后选择“Internet选项”，后续操作同上。</p>
            </li>
            <li>点击【打印设置】按钮，在“页面设置”窗口中设置“纸张大小”为“A4”，“纵向”;不要改动其他选项，点击【确定】按钮。</li>
            <li>点击页面上的【打印准考证】按钮打印准考证。</li>
        </ul>
        <hr />
		<object id="printWB" style="dispaly:none" classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"></object>
		<input type="button" value="打印设置" onclick="doPrintSetup();" />
		<input type="button" value="打印预览" onclick="doPrintPreview();" />
        <input type="button" value="打印准考证" onclick="doPrint();" />
    </div>
    <table width="895px" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr class="noprint">
            <td width="16" class="title_lbg IE6png">
            </td>
            <td width="24" class="title_t IE6png">
            </td>
            <td width="950" class="title_libg IE6png">
                考场安排信息
            </td>
            <td width="17" class="title_rbg IE6png">
            </td>
        </tr>
        <tr id="tbCorp" runat="server" style="font-size: 15px;">
            <td class="border_lbg IE6png">
                &nbsp;
            </td>
            <td colspan="2" style="">
                <div id="roomInfo">
                    <p style="font-size:20px;font-weight:bold;">考场名称：<asp:Label ID="lblKCName" runat="server"></asp:Label></p>
                    <p>考场号：<asp:Label ID="lblKCCode" runat="server"></asp:Label></p>
                    <p>考场地址：<asp:Label ID="lblKCAddr" runat="server"></asp:Label></p>
                </div>

                <table width="100%" border="0" align="center" cellpadding="0" class="tab" cellspacing="0"
                    style="text-align: left;">
                    <tr>
                        <td id="seat-container">
                            <asp:Repeater ID="rptEmp" runat="server">
                                <ItemTemplate>
                                    <div class="seat-area">
                                        <div style="float: left;">
                                            <span style="font-weight: bold;">座次号：<%#Eval("SeatCode")%></span><br />
                                            姓名：<%#Eval("EmpName")%><br />
                                            身份证号：<br />
                                            <%#Eval("IDCard")%><br />
                                            准考证号：<br />
                                            <%#Eval("ExamCertCode")%><br />
                                            签名栏：<br />
                                            <div class="signArea"></div>
                                        </div>
                                        <div style="float: right;">
                                            <asp:Image ID="Image1" runat="server" Width="111px" Height="148px" ImageUrl='<%#GetImgUrl(Eval("EmpGuid")) %>' />
                                        </div>
                                    </div>
                                </ItemTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                </table>
            </td>
            <td class="border_rbg IE6png">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="border_lconer IE6png" headers="17">
                &nbsp;
            </td>
            <td colspan="2" class="border_bottomli IE6png" height="17">
                &nbsp;
            </td>
            <td class="border_rconer IE6png" headers="17">
                &nbsp;
            </td>
        </tr>
    </table>
    </div>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <asp:HiddenField ID="hidType" runat="server" />
    <asp:HiddenField ID="hidQCId" runat="server" />
    <asp:HiddenField ID="hidSys" runat="server" Value="EF" />
    <asp:HiddenField ID="hidFunc" runat="server" Value="Person" />
    </form>
</body>
</html>
